Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSL #66

Merged
merged 70 commits into from
Oct 31, 2023
Merged

CSL #66

merged 70 commits into from
Oct 31, 2023

Conversation

reknih
Copy link
Member

@reknih reknih commented Oct 19, 2023

This PR implements CSL. cf. #32, typst/typst#2406, typst/typst#132
All known styles are tested to the extent that they don't cause a panic.

The following remains to do:

  • Correctly map the CSL concept of original metadata onto Hayagriva entries in Taxonomy.
  • Change Serial Number type to a dictionary and remove top-level doi etc. from Entry
  • givenname-disambiguation-rule is not applied to disambiguate names within a cite.
  • collapse="year" deletes the year, but not the surrounding delimiters. It should rerender the item instead.
  • collapse="year-suffix" and collapse="year-suffix-ranged" is ignored.
  • subsequent-author-substitute is ignored.
  • Decide whether to export members as-is or in submodules.

Maybe we should also use the test suite, however, this would require injecting CSL variables directly, bypassing the Entry struct.

@reknih reknih merged commit 46005f6 into main Oct 31, 2023
1 check passed
@stellarpower
Copy link

Sorry if this is a silly question - should this allow me to use CSL YAML/JSON (output by Zotero) as the input format for the Hayagriva CLI? Or is this MR only for using the XML schema for the citation style?

@yochem
Copy link
Contributor

yochem commented Nov 24, 2023

Sorry if this is a silly question - should this allow me to use CSL YAML/JSON (output by Zotero) as the input format for the Hayagriva CLI? Or is this MR only for using the XML schema for the citation style?

I'm wondering this too. It seems that hayagriva is not able to parse CSL yaml files currently: failed to parse YAML (invalid type: sequence, expected a map between cite keys and entries)

@reknih
Copy link
Member Author

reknih commented Nov 24, 2023

Yes, this PR is only about CSL style files. I implemented CSL-JSON support for testing only (not exposed for library users), and right now, the structs are generic in such a way that CSL-JSON cannot be mixed with BibLaTeX/Hayagriva YAML. It could be a good contribution to allow users to bring CSL-JSON and mix it with other bibliographic formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants